package com.gshg.log.cleanlog.quartz.demo;

import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class JobDetailDemo2 extends QuartzJobBean {

    @Autowired
    private DemoSerice demoSerice;
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDataMap jdm = jobExecutionContext.getMergedJobDataMap();
        String jobId = jobExecutionContext.getFireInstanceId();
        long jobRunTime = jobExecutionContext.getJobRunTime();
        JobDetail detail = jobExecutionContext.getJobDetail();

        demoSerice.testDemo(detail.getDescription()+"["+jobId+"]jobRunTime["+jobRunTime+"]", System.currentTimeMillis());

    }
}
